package demo2;

public class Test2 {
    //局部内部类
    public void test(){
        class InnerClass{
            public int data1 =1;
            public void test(){
                System.out.println("Inner:func()");
            }
        }
        //实例化只能在方法内部进行
        InnerClass innerClass = new InnerClass();
        innerClass.test();
    }

    public static void main(String[] args) {
        Test2 test = new Test2();
        test.test();
    }
}
